<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="database.DAO,golf.ItemList,java.util.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
	request.setCharacterEncoding("utf-8");
	DAO dao = DAO.getInstance();
	String target = request.getParameter("select");
	int t = Integer.parseInt(target);
	String[] info= request.getParameterValues("info");
	int charNo = (Integer)session.getAttribute("charNo");

	if(info!=null)
	{
		if(t==1)
		{
			for(int i=0;i<info.length;i++)
			{
				StringTokenizer a= new StringTokenizer(info[i], "+");
				int j= Integer.parseInt(a.nextToken());
				int k= Integer.parseInt(a.nextToken());
				out.println(dao.caddyItem(charNo,k,j,2));
				
			}
		}
		else if(t==2)
		{
			for(int i=0;i<info.length;i++)
			{
				StringTokenizer c = new StringTokenizer(info[i], "+");
				int j= Integer.parseInt(c.nextToken());
				int k= Integer.parseInt(c.nextToken());
				out.println(dao.caddyItem(charNo,k,j,1));
				
			}
			
		}
		else
		{
			System.out.println("선택된 값이 없습니다.");
		}
	}
	else
	{
		System.out.println("선택된 값이 없습니다");
	}
	
	
	//response.sendRedirect("../jsp/manageItem.jsp");
%>